<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 200px;
        height: 200px;
        border: 1px solid black;
      }
      .box1 {
        background-color: gray;
      }
      .box2 {
        background-color: orange;
      }
    </style>
  </head>
  <body>
    <!-- contenteditable 属性，设置可编辑 -->
    <div class="box1" contenteditable="true">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque, adipisci!
    </div>
    <!-- draggable 拖拽属性   onDragEnd 拖拽结束事件 -->
    <div class="box2" draggable="true" ondragend="go(event)">
      Lorem ipsum dolor sit amet.
    </div>

    <script>
      function go(e) {
        alert(e.x);
      }
    </script>
  </body>
</html>
